﻿using System.Web;

namespace EpiInfoCloudMagpiBridge.Models
{
    public static class ApplicationModel
    {

        private static string currentEwavUserId = "";

        public static bool LoggedOn
        {
            get
            {
                // return currentEwavUserId != null;    
                return currentEwavUserId.Length > 0;        
            }
        }

        public static string CurrentEwavUserId
        {
            get
            {
                if (currentEwavUserId == null)
                    //   throw new Exception("No user currently logged on");
                    HttpContext.Current.Response.RedirectToRoute("Default");


                return currentEwavUserId;
            }
            set
            {
                currentEwavUserId = value;
            }

        }


        //  public static string CurrentEwavUserId { get; set; }
    }
}